//
//  NIDropDownList.h
//  AccuroScale
//
//  Created by Yongfeng Li on 4/4/14.
//  Copyright (c) 2014 Yongfeng Li. All rights reserved.
//

#import <UIKit/UIKit.h>

@class NIDropDownList;

//typedef UITableViewCell* (^NIDropDownListCellsBlock)(NIDropDownList *alert, NSIndexPath *indexPath);

@protocol NIDropDownDelegate <NSObject>
@required
- (NSString *) niDropDownDelegateMethod: (NIDropDownList *) sender;

@optional
- (void) accessTypeTapedTip:(BOOL)bTip;
- (void) deleteRowInvoke;
@end


@interface NIDropDownList : UIView <UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate>
@property short nType;
@property BOOL isPopup;
@property int nProdSelIds;

@property (nonatomic, retain) UITableView* table;
@property (nonatomic, strong) NSString* sCurBodyId;
@property (nonatomic, strong) NSString* sSelText;
@property (nonatomic, strong) NSString* sSelValId;
@property (nonatomic, assign) NSInteger nSelectIdx;

@property (nonatomic, retain) NSString* sCurConnBLeDev;
@property (nonatomic, retain) NSDictionary* dirList;
@property (nonatomic, strong) NSArray* sortedKeys;

@property (nonatomic, retain) id <NIDropDownDelegate> delegate;
@property (nonatomic, assign) BOOL bDeviceOwner;

//@property (nonatomic, strong) NIDropDownListCellsBlock cells;
/*@property(nonatomic, strong) UITableView *table;
@property(nonatomic, strong) UIView *btnSender;
@property(nonatomic, retain) NSArray *list;
@property(nonatomic, retain) NSArray *imageList;
@property (nonatomic, retain) NSString *animationDirection;*/
- (id)initWithFrame:(CGRect)frame type:(short) nType;

//- (void) setMenuAppearance;
- (void) hideDropDownList;
//- (id )showDropDownList:(UIView *)btnItem hgt:(CGFloat *)fHgt data:(NSArray *)arr img:(NSArray *)iArr dir:(NSString *)direction;
- (void) showDropDownList:(NSDictionary *)dirList curSel:(NSString*)sBodyId;
//- (void) popupOption:(NSDictionary *)dirList curSel:(NSString*)sBodyId andCells:(NIDropDownListCellsBlock)cellsBlock;

- (void) setTableRect:(CGRect)frame;
- (void) setFrameRect:(CGRect)frame;
- (void) setListData:(NSDictionary *)dirList curSel:(NSString*)sBodyId;
//-(void) setOptionData:(NSArray *)arrList curSel:(NSString*)sBodyId;

- (void) popupDropDownList;
- (NSString*) getItemText:(NSUInteger)nIdx key:(NSString**) sKey;

- (void) setBkgdColor:(UIColor*)colBkgd;
- (void) deleteHrateRow:(NSInteger)nHrateId row:(NSInteger)nIdx;

- (void) resetCellBgrd:(NSInteger)nRow;

@end
